<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
namespace HyperfTest\Cases;

use App\Service\Redis\UserAuth;
use HyperfTest\HttpTestCase;

/**
 * @internal
 * @coversNothing
 */
class AnswerTest extends HttpTestCase
{
    public function testAnswerPublish()
    {
        $res = $this->json('/answer/1', [
            'question_id' => 1,
            'summary' => '当然不行，这是犯法的',
        ], [
            UserAuth::X_TOKEN => $this->getToken(),
        ]);

        $this->assertSame(0, $res['code']);
    }

    public function testAnswerIndex()
    {
        $res = $this->get('/answer', [
            'question_id' => 1,
        ]);

        $this->assertSame(0, $res['code']);
    }
}
